<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	template="forms/default/template.xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:web="http://www.web.com.br/jsf/webutils">

	<ui:define name="breadcrumbEvento">

		<web:breadcrumb urlIndex="/index.xhtml">

			<p:menuitem value="#{messages['navegacao.eventoinscricao']}" />

		</web:breadcrumb>

	</ui:define>

	<ui:define name="contentEvento">
		
		#{eventoInscricaoUI.buscarEvento()}
				
		<fieldset id="fieldsetLogin" style="padding: 10px">

			<legend style="font-weight: bold; font-size: 16px; width: auto;">#{messages['label.eventoinscricao']}</legend>

			<h:panelGrid columns="2">

				<h:panelGroup rendered="#{web:nvl(rendered, true)}">
					<div style="float: left; width: 120px; text-align: right;">
						<h:outputText id="labelEvento"
							value="#{messages['label.evento']}:" style="font-size: 14px;" />
					</div>
				</h:panelGroup>

				<h:panelGroup rendered="#{web:nvl(rendered, true)}">
					<div style="float: left; width: 360px; text-align: left;">
						<h:outputText id="inputEvento"
							value="#{eventoInscricaoUI.evento.nome}"
							style="font-size: 14px; font-weight: bold;" />
					</div>
				</h:panelGroup>

			</h:panelGrid>

			<h:panelGrid columns="2">

				<h:panelGroup rendered="#{web:nvl(rendered, true)}">
					<div style="float: left; width: 120px; text-align: right;">
						<h:outputText id="labelInscricoes"
							value="#{messages['label.inscricoes']}:" style="font-size: 14px;" />
					</div>
				</h:panelGroup>

				<h:panelGroup rendered="#{web:nvl(rendered, true)}">

					<web:dataTable id="gridInscricoes"
						rendered="#{not empty eventoInscricaoUI.inscricoes}"
						styleClass="dataTable-1" mode="1"
						value="#{eventoInscricaoUI.inscricoes}"
						selection="#{eventoInscricaoUI.selectedInscricao}"
						rowKey="#{dataTableItem.id}" paginator="false">

						<ui:define name="columns">

							<p:column selectionMode="single"
								style="text-align: center; width: 100px;" />

							<web:column id="eventosColumnDescricao" align="center"
								title="#{messages['label.descricao']}" width="700px">
								<h:outputText style="text-align: center; display: block;"
									value="#{dataTableItem.descricao}" />
							</web:column>

							<web:column id="eventosColumnValor" align="center"
								title="#{messages['label.valorinscricao']}" width="200px">
								<h:outputText style="text-align: center; display: block;"
									value="#{dataTableItem.valorInscricao}">
									<f:convertNumber locale="#{localeUI.locale}"
										pattern="R$ ###,###,##0.00" />
								</h:outputText>
							</web:column>

						</ui:define>

					</web:dataTable>

				</h:panelGroup>

			</h:panelGrid>

			<!-- 			
			<h:panelGrid columns="2">

				<h:panelGroup rendered="#{web:nvl(rendered, true)}">
					<div style="float: left; width: 120px; text-align: right;">
						<h:outputText id="labelTotal"
							value="#{messages['label.Total']}:" style="font-size: 14px;" />
					</div>
				</h:panelGroup>

				<h:panelGroup rendered="#{web:nvl(rendered, true)}">
					<h:outputText id="valorTotal" style="text-align: center; display: block;"
						value="#{eventoInscricaoUI.valorTotal}" />
				</h:panelGroup>

			</h:panelGrid>
			 -->

		</fieldset>

		<fieldset id="fieldsetOpcoes" style="padding: 10px">

			<legend style="font-weight: bold; font-size: 16px; width: auto;">#{messages['global.opcoes.fieldset']}</legend>

			<h:panelGrid columns="2">

				<web:outputTextField id="btnIncluirLabel" value=".:"
					required="false" width="120px" align="right" />

				<web:field for="btnIncluir" mode="1" required="false"
					addMessage="false">

					<p:commandButton id="btnIncluir"
						value="#{messages['label.confirmarinscricao']}" update="@form"
						action="#{eventoInscricaoUI.save}" ajax="true"
						icon="#{messages['global.operations.save.icon']}" process="@form"
						style="margin-right: 5px;" />

					<p:commandButton id="btnVoltar" value="#{messages['label.voltar']}"
						action="#{eventoInscricaoUI.voltar}" immediate="true" />

				</web:field>

			</h:panelGrid>

		</fieldset>

	</ui:define>

</ui:composition>